/**
 * Autogenerated by Thrift
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 */
#include "Types_types.h"

namespace evernote { namespace edam {

const char* Data::ascii_fingerprint = "BAAB2C3118BDB468C051932BB163B2AF";
const uint8_t Data::binary_fingerprint[16] = {0xBA,0xAB,0x2C,0x31,0x18,0xBD,0xB4,0x68,0xC0,0x51,0x93,0x2B,0xB1,0x63,0xB2,0xAF};

uint32_t Data::read(::apache::thrift::protocol::TProtocol* iprot) {

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;


  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readBinary(this->bodyHash);
          this->__isset.bodyHash = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->size);
          this->__isset.size = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readBinary(this->body);
          this->__isset.body = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t Data::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  xfer += oprot->writeStructBegin("Data");
  if (this->__isset.bodyHash) {
    xfer += oprot->writeFieldBegin("bodyHash", ::apache::thrift::protocol::T_STRING, 1);
    xfer += oprot->writeBinary(this->bodyHash);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.size) {
    xfer += oprot->writeFieldBegin("size", ::apache::thrift::protocol::T_I32, 2);
    xfer += oprot->writeI32(this->size);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.body) {
    xfer += oprot->writeFieldBegin("body", ::apache::thrift::protocol::T_STRING, 3);
    xfer += oprot->writeBinary(this->body);
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

const char* UserAttributes::ascii_fingerprint = "6CAC11DEC2432B22604C49C302DEDA87";
const uint8_t UserAttributes::binary_fingerprint[16] = {0x6C,0xAC,0x11,0xDE,0xC2,0x43,0x2B,0x22,0x60,0x4C,0x49,0xC3,0x02,0xDE,0xDA,0x87};

uint32_t UserAttributes::read(::apache::thrift::protocol::TProtocol* iprot) {

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;


  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->defaultLocationName);
          this->__isset.defaultLocationName = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_DOUBLE) {
          xfer += iprot->readDouble(this->defaultLatitude);
          this->__isset.defaultLatitude = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_DOUBLE) {
          xfer += iprot->readDouble(this->defaultLongitude);
          this->__isset.defaultLongitude = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->preactivation);
          this->__isset.preactivation = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 5:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->viewedPromotions.clear();
            uint32_t _size0;
            ::apache::thrift::protocol::TType _etype3;
            iprot->readListBegin(_etype3, _size0);
            this->viewedPromotions.resize(_size0);
            uint32_t _i4;
            for (_i4 = 0; _i4 < _size0; ++_i4)
            {
              xfer += iprot->readString(this->viewedPromotions[_i4]);
            }
            iprot->readListEnd();
          }
          this->__isset.viewedPromotions = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 6:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->incomingEmailAddress);
          this->__isset.incomingEmailAddress = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 7:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->recentMailedAddresses.clear();
            uint32_t _size5;
            ::apache::thrift::protocol::TType _etype8;
            iprot->readListBegin(_etype8, _size5);
            this->recentMailedAddresses.resize(_size5);
            uint32_t _i9;
            for (_i9 = 0; _i9 < _size5; ++_i9)
            {
              xfer += iprot->readString(this->recentMailedAddresses[_i9]);
            }
            iprot->readListEnd();
          }
          this->__isset.recentMailedAddresses = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 9:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->comments);
          this->__isset.comments = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 11:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->dateAgreedToTermsOfService);
          this->__isset.dateAgreedToTermsOfService = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 12:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->maxReferrals);
          this->__isset.maxReferrals = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 13:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->referralCount);
          this->__isset.referralCount = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 14:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->refererCode);
          this->__isset.refererCode = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 15:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->sentEmailDate);
          this->__isset.sentEmailDate = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 16:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->sentEmailCount);
          this->__isset.sentEmailCount = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 17:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->dailyEmailLimit);
          this->__isset.dailyEmailLimit = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 18:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->emailOptOutDate);
          this->__isset.emailOptOutDate = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 19:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->partnerEmailOptInDate);
          this->__isset.partnerEmailOptInDate = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 20:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->preferredLanguage);
          this->__isset.preferredLanguage = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 21:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->preferredCountry);
          this->__isset.preferredCountry = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 22:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->clipFullPage);
          this->__isset.clipFullPage = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 23:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->twitterUserName);
          this->__isset.twitterUserName = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 24:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->twitterId);
          this->__isset.twitterId = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 25:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->groupName);
          this->__isset.groupName = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 26:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->recognitionLanguage);
          this->__isset.recognitionLanguage = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 27:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->customerProfileId);
          this->__isset.customerProfileId = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 28:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->referralProof);
          this->__isset.referralProof = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 29:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->educationalDiscount);
          this->__isset.educationalDiscount = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 30:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->businessAddress);
          this->__isset.businessAddress = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 31:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->hideSponsorBilling);
          this->__isset.hideSponsorBilling = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t UserAttributes::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  xfer += oprot->writeStructBegin("UserAttributes");
  if (this->__isset.defaultLocationName) {
    xfer += oprot->writeFieldBegin("defaultLocationName", ::apache::thrift::protocol::T_STRING, 1);
    xfer += oprot->writeString(this->defaultLocationName);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.defaultLatitude) {
    xfer += oprot->writeFieldBegin("defaultLatitude", ::apache::thrift::protocol::T_DOUBLE, 2);
    xfer += oprot->writeDouble(this->defaultLatitude);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.defaultLongitude) {
    xfer += oprot->writeFieldBegin("defaultLongitude", ::apache::thrift::protocol::T_DOUBLE, 3);
    xfer += oprot->writeDouble(this->defaultLongitude);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.preactivation) {
    xfer += oprot->writeFieldBegin("preactivation", ::apache::thrift::protocol::T_BOOL, 4);
    xfer += oprot->writeBool(this->preactivation);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.viewedPromotions) {
    xfer += oprot->writeFieldBegin("viewedPromotions", ::apache::thrift::protocol::T_LIST, 5);
    {
      xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, this->viewedPromotions.size());
      std::vector<std::string> ::const_iterator _iter10;
      for (_iter10 = this->viewedPromotions.begin(); _iter10 != this->viewedPromotions.end(); ++_iter10)
      {
        xfer += oprot->writeString((*_iter10));
      }
      xfer += oprot->writeListEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.incomingEmailAddress) {
    xfer += oprot->writeFieldBegin("incomingEmailAddress", ::apache::thrift::protocol::T_STRING, 6);
    xfer += oprot->writeString(this->incomingEmailAddress);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.recentMailedAddresses) {
    xfer += oprot->writeFieldBegin("recentMailedAddresses", ::apache::thrift::protocol::T_LIST, 7);
    {
      xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, this->recentMailedAddresses.size());
      std::vector<std::string> ::const_iterator _iter11;
      for (_iter11 = this->recentMailedAddresses.begin(); _iter11 != this->recentMailedAddresses.end(); ++_iter11)
      {
        xfer += oprot->writeString((*_iter11));
      }
      xfer += oprot->writeListEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.comments) {
    xfer += oprot->writeFieldBegin("comments", ::apache::thrift::protocol::T_STRING, 9);
    xfer += oprot->writeString(this->comments);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.dateAgreedToTermsOfService) {
    xfer += oprot->writeFieldBegin("dateAgreedToTermsOfService", ::apache::thrift::protocol::T_I64, 11);
    xfer += oprot->writeI64(this->dateAgreedToTermsOfService);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.maxReferrals) {
    xfer += oprot->writeFieldBegin("maxReferrals", ::apache::thrift::protocol::T_I32, 12);
    xfer += oprot->writeI32(this->maxReferrals);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.referralCount) {
    xfer += oprot->writeFieldBegin("referralCount", ::apache::thrift::protocol::T_I32, 13);
    xfer += oprot->writeI32(this->referralCount);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.refererCode) {
    xfer += oprot->writeFieldBegin("refererCode", ::apache::thrift::protocol::T_STRING, 14);
    xfer += oprot->writeString(this->refererCode);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.sentEmailDate) {
    xfer += oprot->writeFieldBegin("sentEmailDate", ::apache::thrift::protocol::T_I64, 15);
    xfer += oprot->writeI64(this->sentEmailDate);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.sentEmailCount) {
    xfer += oprot->writeFieldBegin("sentEmailCount", ::apache::thrift::protocol::T_I32, 16);
    xfer += oprot->writeI32(this->sentEmailCount);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.dailyEmailLimit) {
    xfer += oprot->writeFieldBegin("dailyEmailLimit", ::apache::thrift::protocol::T_I32, 17);
    xfer += oprot->writeI32(this->dailyEmailLimit);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.emailOptOutDate) {
    xfer += oprot->writeFieldBegin("emailOptOutDate", ::apache::thrift::protocol::T_I64, 18);
    xfer += oprot->writeI64(this->emailOptOutDate);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.partnerEmailOptInDate) {
    xfer += oprot->writeFieldBegin("partnerEmailOptInDate", ::apache::thrift::protocol::T_I64, 19);
    xfer += oprot->writeI64(this->partnerEmailOptInDate);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.preferredLanguage) {
    xfer += oprot->writeFieldBegin("preferredLanguage", ::apache::thrift::protocol::T_STRING, 20);
    xfer += oprot->writeString(this->preferredLanguage);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.preferredCountry) {
    xfer += oprot->writeFieldBegin("preferredCountry", ::apache::thrift::protocol::T_STRING, 21);
    xfer += oprot->writeString(this->preferredCountry);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.clipFullPage) {
    xfer += oprot->writeFieldBegin("clipFullPage", ::apache::thrift::protocol::T_BOOL, 22);
    xfer += oprot->writeBool(this->clipFullPage);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.twitterUserName) {
    xfer += oprot->writeFieldBegin("twitterUserName", ::apache::thrift::protocol::T_STRING, 23);
    xfer += oprot->writeString(this->twitterUserName);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.twitterId) {
    xfer += oprot->writeFieldBegin("twitterId", ::apache::thrift::protocol::T_STRING, 24);
    xfer += oprot->writeString(this->twitterId);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.groupName) {
    xfer += oprot->writeFieldBegin("groupName", ::apache::thrift::protocol::T_STRING, 25);
    xfer += oprot->writeString(this->groupName);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.recognitionLanguage) {
    xfer += oprot->writeFieldBegin("recognitionLanguage", ::apache::thrift::protocol::T_STRING, 26);
    xfer += oprot->writeString(this->recognitionLanguage);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.customerProfileId) {
    xfer += oprot->writeFieldBegin("customerProfileId", ::apache::thrift::protocol::T_I64, 27);
    xfer += oprot->writeI64(this->customerProfileId);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.referralProof) {
    xfer += oprot->writeFieldBegin("referralProof", ::apache::thrift::protocol::T_STRING, 28);
    xfer += oprot->writeString(this->referralProof);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.educationalDiscount) {
    xfer += oprot->writeFieldBegin("educationalDiscount", ::apache::thrift::protocol::T_BOOL, 29);
    xfer += oprot->writeBool(this->educationalDiscount);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.businessAddress) {
    xfer += oprot->writeFieldBegin("businessAddress", ::apache::thrift::protocol::T_STRING, 30);
    xfer += oprot->writeString(this->businessAddress);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.hideSponsorBilling) {
    xfer += oprot->writeFieldBegin("hideSponsorBilling", ::apache::thrift::protocol::T_BOOL, 31);
    xfer += oprot->writeBool(this->hideSponsorBilling);
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

const char* Accounting::ascii_fingerprint = "23B10A942EDA85D9402DED7C09922347";
const uint8_t Accounting::binary_fingerprint[16] = {0x23,0xB1,0x0A,0x94,0x2E,0xDA,0x85,0xD9,0x40,0x2D,0xED,0x7C,0x09,0x92,0x23,0x47};

uint32_t Accounting::read(::apache::thrift::protocol::TProtocol* iprot) {

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;


  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->uploadLimit);
          this->__isset.uploadLimit = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->uploadLimitEnd);
          this->__isset.uploadLimitEnd = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->uploadLimitNextMonth);
          this->__isset.uploadLimitNextMonth = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          int32_t ecast12;
          xfer += iprot->readI32(ecast12);
          this->premiumServiceStatus = (PremiumOrderStatus)ecast12;
          this->__isset.premiumServiceStatus = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 5:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->premiumOrderNumber);
          this->__isset.premiumOrderNumber = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 6:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->premiumCommerceService);
          this->__isset.premiumCommerceService = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 7:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->premiumServiceStart);
          this->__isset.premiumServiceStart = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 8:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->premiumServiceSKU);
          this->__isset.premiumServiceSKU = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 9:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->lastSuccessfulCharge);
          this->__isset.lastSuccessfulCharge = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 10:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->lastFailedCharge);
          this->__isset.lastFailedCharge = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 11:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->lastFailedChargeReason);
          this->__isset.lastFailedChargeReason = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 12:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->nextPaymentDue);
          this->__isset.nextPaymentDue = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 13:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->premiumLockUntil);
          this->__isset.premiumLockUntil = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 14:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->updated);
          this->__isset.updated = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 16:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->premiumSubscriptionNumber);
          this->__isset.premiumSubscriptionNumber = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 17:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->lastRequestedCharge);
          this->__isset.lastRequestedCharge = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 18:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->currency);
          this->__isset.currency = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 19:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->unitPrice);
          this->__isset.unitPrice = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t Accounting::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  xfer += oprot->writeStructBegin("Accounting");
  if (this->__isset.uploadLimit) {
    xfer += oprot->writeFieldBegin("uploadLimit", ::apache::thrift::protocol::T_I64, 1);
    xfer += oprot->writeI64(this->uploadLimit);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.uploadLimitEnd) {
    xfer += oprot->writeFieldBegin("uploadLimitEnd", ::apache::thrift::protocol::T_I64, 2);
    xfer += oprot->writeI64(this->uploadLimitEnd);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.uploadLimitNextMonth) {
    xfer += oprot->writeFieldBegin("uploadLimitNextMonth", ::apache::thrift::protocol::T_I64, 3);
    xfer += oprot->writeI64(this->uploadLimitNextMonth);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.premiumServiceStatus) {
    xfer += oprot->writeFieldBegin("premiumServiceStatus", ::apache::thrift::protocol::T_I32, 4);
    xfer += oprot->writeI32((int32_t)this->premiumServiceStatus);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.premiumOrderNumber) {
    xfer += oprot->writeFieldBegin("premiumOrderNumber", ::apache::thrift::protocol::T_STRING, 5);
    xfer += oprot->writeString(this->premiumOrderNumber);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.premiumCommerceService) {
    xfer += oprot->writeFieldBegin("premiumCommerceService", ::apache::thrift::protocol::T_STRING, 6);
    xfer += oprot->writeString(this->premiumCommerceService);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.premiumServiceStart) {
    xfer += oprot->writeFieldBegin("premiumServiceStart", ::apache::thrift::protocol::T_I64, 7);
    xfer += oprot->writeI64(this->premiumServiceStart);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.premiumServiceSKU) {
    xfer += oprot->writeFieldBegin("premiumServiceSKU", ::apache::thrift::protocol::T_STRING, 8);
    xfer += oprot->writeString(this->premiumServiceSKU);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.lastSuccessfulCharge) {
    xfer += oprot->writeFieldBegin("lastSuccessfulCharge", ::apache::thrift::protocol::T_I64, 9);
    xfer += oprot->writeI64(this->lastSuccessfulCharge);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.lastFailedCharge) {
    xfer += oprot->writeFieldBegin("lastFailedCharge", ::apache::thrift::protocol::T_I64, 10);
    xfer += oprot->writeI64(this->lastFailedCharge);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.lastFailedChargeReason) {
    xfer += oprot->writeFieldBegin("lastFailedChargeReason", ::apache::thrift::protocol::T_STRING, 11);
    xfer += oprot->writeString(this->lastFailedChargeReason);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.nextPaymentDue) {
    xfer += oprot->writeFieldBegin("nextPaymentDue", ::apache::thrift::protocol::T_I64, 12);
    xfer += oprot->writeI64(this->nextPaymentDue);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.premiumLockUntil) {
    xfer += oprot->writeFieldBegin("premiumLockUntil", ::apache::thrift::protocol::T_I64, 13);
    xfer += oprot->writeI64(this->premiumLockUntil);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.updated) {
    xfer += oprot->writeFieldBegin("updated", ::apache::thrift::protocol::T_I64, 14);
    xfer += oprot->writeI64(this->updated);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.premiumSubscriptionNumber) {
    xfer += oprot->writeFieldBegin("premiumSubscriptionNumber", ::apache::thrift::protocol::T_STRING, 16);
    xfer += oprot->writeString(this->premiumSubscriptionNumber);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.lastRequestedCharge) {
    xfer += oprot->writeFieldBegin("lastRequestedCharge", ::apache::thrift::protocol::T_I64, 17);
    xfer += oprot->writeI64(this->lastRequestedCharge);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.currency) {
    xfer += oprot->writeFieldBegin("currency", ::apache::thrift::protocol::T_STRING, 18);
    xfer += oprot->writeString(this->currency);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.unitPrice) {
    xfer += oprot->writeFieldBegin("unitPrice", ::apache::thrift::protocol::T_I32, 19);
    xfer += oprot->writeI32(this->unitPrice);
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

const char* User::ascii_fingerprint = "4355DE4397AAC316893BF7D65A259E7E";
const uint8_t User::binary_fingerprint[16] = {0x43,0x55,0xDE,0x43,0x97,0xAA,0xC3,0x16,0x89,0x3B,0xF7,0xD6,0x5A,0x25,0x9E,0x7E};

uint32_t User::read(::apache::thrift::protocol::TProtocol* iprot) {

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;


  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->id);
          this->__isset.id = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->username);
          this->__isset.username = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->email);
          this->__isset.email = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->name);
          this->__isset.name = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 6:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->timezone);
          this->__isset.timezone = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 7:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          int32_t ecast13;
          xfer += iprot->readI32(ecast13);
          this->privilege = (PrivilegeLevel)ecast13;
          this->__isset.privilege = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 9:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->created);
          this->__isset.created = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 10:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->updated);
          this->__isset.updated = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 11:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->deleted);
          this->__isset.deleted = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 13:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->active);
          this->__isset.active = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 14:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->shardId);
          this->__isset.shardId = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 15:
        if (ftype == ::apache::thrift::protocol::T_STRUCT) {
          xfer += this->attributes.read(iprot);
          this->__isset.attributes = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 16:
        if (ftype == ::apache::thrift::protocol::T_STRUCT) {
          xfer += this->accounting.read(iprot);
          this->__isset.accounting = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t User::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  xfer += oprot->writeStructBegin("User");
  if (this->__isset.id) {
    xfer += oprot->writeFieldBegin("id", ::apache::thrift::protocol::T_I32, 1);
    xfer += oprot->writeI32(this->id);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.username) {
    xfer += oprot->writeFieldBegin("username", ::apache::thrift::protocol::T_STRING, 2);
    xfer += oprot->writeString(this->username);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.email) {
    xfer += oprot->writeFieldBegin("email", ::apache::thrift::protocol::T_STRING, 3);
    xfer += oprot->writeString(this->email);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.name) {
    xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 4);
    xfer += oprot->writeString(this->name);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.timezone) {
    xfer += oprot->writeFieldBegin("timezone", ::apache::thrift::protocol::T_STRING, 6);
    xfer += oprot->writeString(this->timezone);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.privilege) {
    xfer += oprot->writeFieldBegin("privilege", ::apache::thrift::protocol::T_I32, 7);
    xfer += oprot->writeI32((int32_t)this->privilege);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.created) {
    xfer += oprot->writeFieldBegin("created", ::apache::thrift::protocol::T_I64, 9);
    xfer += oprot->writeI64(this->created);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.updated) {
    xfer += oprot->writeFieldBegin("updated", ::apache::thrift::protocol::T_I64, 10);
    xfer += oprot->writeI64(this->updated);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.deleted) {
    xfer += oprot->writeFieldBegin("deleted", ::apache::thrift::protocol::T_I64, 11);
    xfer += oprot->writeI64(this->deleted);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.active) {
    xfer += oprot->writeFieldBegin("active", ::apache::thrift::protocol::T_BOOL, 13);
    xfer += oprot->writeBool(this->active);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.shardId) {
    xfer += oprot->writeFieldBegin("shardId", ::apache::thrift::protocol::T_STRING, 14);
    xfer += oprot->writeString(this->shardId);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.attributes) {
    xfer += oprot->writeFieldBegin("attributes", ::apache::thrift::protocol::T_STRUCT, 15);
    xfer += this->attributes.write(oprot);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.accounting) {
    xfer += oprot->writeFieldBegin("accounting", ::apache::thrift::protocol::T_STRUCT, 16);
    xfer += this->accounting.write(oprot);
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

const char* Tag::ascii_fingerprint = "2E5BF02AE592E16964727D77D7FFB2D2";
const uint8_t Tag::binary_fingerprint[16] = {0x2E,0x5B,0xF0,0x2A,0xE5,0x92,0xE1,0x69,0x64,0x72,0x7D,0x77,0xD7,0xFF,0xB2,0xD2};

uint32_t Tag::read(::apache::thrift::protocol::TProtocol* iprot) {

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;


  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->guid);
          this->__isset.guid = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->name);
          this->__isset.name = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->parentGuid);
          this->__isset.parentGuid = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->updateSequenceNum);
          this->__isset.updateSequenceNum = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t Tag::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  xfer += oprot->writeStructBegin("Tag");
  if (this->__isset.guid) {
    xfer += oprot->writeFieldBegin("guid", ::apache::thrift::protocol::T_STRING, 1);
    xfer += oprot->writeString(this->guid);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.name) {
    xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 2);
    xfer += oprot->writeString(this->name);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.parentGuid) {
    xfer += oprot->writeFieldBegin("parentGuid", ::apache::thrift::protocol::T_STRING, 3);
    xfer += oprot->writeString(this->parentGuid);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.updateSequenceNum) {
    xfer += oprot->writeFieldBegin("updateSequenceNum", ::apache::thrift::protocol::T_I32, 4);
    xfer += oprot->writeI32(this->updateSequenceNum);
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

const char* LazyMap::ascii_fingerprint = "4C4C51B5D8C83C870E0A49A3B26C575F";
const uint8_t LazyMap::binary_fingerprint[16] = {0x4C,0x4C,0x51,0xB5,0xD8,0xC8,0x3C,0x87,0x0E,0x0A,0x49,0xA3,0xB2,0x6C,0x57,0x5F};

uint32_t LazyMap::read(::apache::thrift::protocol::TProtocol* iprot) {

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;


  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_SET) {
          {
            this->keysOnly.clear();
            uint32_t _size14;
            ::apache::thrift::protocol::TType _etype17;
            iprot->readSetBegin(_etype17, _size14);
            uint32_t _i18;
            for (_i18 = 0; _i18 < _size14; ++_i18)
            {
              std::string _elem19;
              xfer += iprot->readString(_elem19);
              this->keysOnly.insert(_elem19);
            }
            iprot->readSetEnd();
          }
          this->__isset.keysOnly = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_MAP) {
          {
            this->fullMap.clear();
            uint32_t _size20;
            ::apache::thrift::protocol::TType _ktype21;
            ::apache::thrift::protocol::TType _vtype22;
            iprot->readMapBegin(_ktype21, _vtype22, _size20);
            uint32_t _i24;
            for (_i24 = 0; _i24 < _size20; ++_i24)
            {
              std::string _key25;
              xfer += iprot->readString(_key25);
              std::string& _val26 = this->fullMap[_key25];
              xfer += iprot->readString(_val26);
            }
            iprot->readMapEnd();
          }
          this->__isset.fullMap = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t LazyMap::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  xfer += oprot->writeStructBegin("LazyMap");
  if (this->__isset.keysOnly) {
    xfer += oprot->writeFieldBegin("keysOnly", ::apache::thrift::protocol::T_SET, 1);
    {
      xfer += oprot->writeSetBegin(::apache::thrift::protocol::T_STRING, this->keysOnly.size());
      std::set<std::string> ::const_iterator _iter27;
      for (_iter27 = this->keysOnly.begin(); _iter27 != this->keysOnly.end(); ++_iter27)
      {
        xfer += oprot->writeString((*_iter27));
      }
      xfer += oprot->writeSetEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.fullMap) {
    xfer += oprot->writeFieldBegin("fullMap", ::apache::thrift::protocol::T_MAP, 2);
    {
      xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, this->fullMap.size());
      std::map<std::string, std::string> ::const_iterator _iter28;
      for (_iter28 = this->fullMap.begin(); _iter28 != this->fullMap.end(); ++_iter28)
      {
        xfer += oprot->writeString(_iter28->first);
        xfer += oprot->writeString(_iter28->second);
      }
      xfer += oprot->writeMapEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

const char* ResourceAttributes::ascii_fingerprint = "5EB9A2A0FEC66DB9B16801F7F67ED0A4";
const uint8_t ResourceAttributes::binary_fingerprint[16] = {0x5E,0xB9,0xA2,0xA0,0xFE,0xC6,0x6D,0xB9,0xB1,0x68,0x01,0xF7,0xF6,0x7E,0xD0,0xA4};

uint32_t ResourceAttributes::read(::apache::thrift::protocol::TProtocol* iprot) {

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;


  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->sourceURL);
          this->__isset.sourceURL = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->timestamp);
          this->__isset.timestamp = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_DOUBLE) {
          xfer += iprot->readDouble(this->latitude);
          this->__isset.latitude = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_DOUBLE) {
          xfer += iprot->readDouble(this->longitude);
          this->__isset.longitude = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 5:
        if (ftype == ::apache::thrift::protocol::T_DOUBLE) {
          xfer += iprot->readDouble(this->altitude);
          this->__isset.altitude = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 6:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->cameraMake);
          this->__isset.cameraMake = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 7:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->cameraModel);
          this->__isset.cameraModel = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 8:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->clientWillIndex);
          this->__isset.clientWillIndex = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 9:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->recoType);
          this->__isset.recoType = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 10:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->fileName);
          this->__isset.fileName = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 11:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->attachment);
          this->__isset.attachment = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 12:
        if (ftype == ::apache::thrift::protocol::T_STRUCT) {
          xfer += this->applicationData.read(iprot);
          this->__isset.applicationData = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t ResourceAttributes::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  xfer += oprot->writeStructBegin("ResourceAttributes");
  if (this->__isset.sourceURL) {
    xfer += oprot->writeFieldBegin("sourceURL", ::apache::thrift::protocol::T_STRING, 1);
    xfer += oprot->writeString(this->sourceURL);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.timestamp) {
    xfer += oprot->writeFieldBegin("timestamp", ::apache::thrift::protocol::T_I64, 2);
    xfer += oprot->writeI64(this->timestamp);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.latitude) {
    xfer += oprot->writeFieldBegin("latitude", ::apache::thrift::protocol::T_DOUBLE, 3);
    xfer += oprot->writeDouble(this->latitude);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.longitude) {
    xfer += oprot->writeFieldBegin("longitude", ::apache::thrift::protocol::T_DOUBLE, 4);
    xfer += oprot->writeDouble(this->longitude);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.altitude) {
    xfer += oprot->writeFieldBegin("altitude", ::apache::thrift::protocol::T_DOUBLE, 5);
    xfer += oprot->writeDouble(this->altitude);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.cameraMake) {
    xfer += oprot->writeFieldBegin("cameraMake", ::apache::thrift::protocol::T_STRING, 6);
    xfer += oprot->writeString(this->cameraMake);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.cameraModel) {
    xfer += oprot->writeFieldBegin("cameraModel", ::apache::thrift::protocol::T_STRING, 7);
    xfer += oprot->writeString(this->cameraModel);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.clientWillIndex) {
    xfer += oprot->writeFieldBegin("clientWillIndex", ::apache::thrift::protocol::T_BOOL, 8);
    xfer += oprot->writeBool(this->clientWillIndex);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.recoType) {
    xfer += oprot->writeFieldBegin("recoType", ::apache::thrift::protocol::T_STRING, 9);
    xfer += oprot->writeString(this->recoType);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.fileName) {
    xfer += oprot->writeFieldBegin("fileName", ::apache::thrift::protocol::T_STRING, 10);
    xfer += oprot->writeString(this->fileName);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.attachment) {
    xfer += oprot->writeFieldBegin("attachment", ::apache::thrift::protocol::T_BOOL, 11);
    xfer += oprot->writeBool(this->attachment);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.applicationData) {
    xfer += oprot->writeFieldBegin("applicationData", ::apache::thrift::protocol::T_STRUCT, 12);
    xfer += this->applicationData.write(oprot);
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

const char* Resource::ascii_fingerprint = "DE051FC9AA97874E785B790F8086691F";
const uint8_t Resource::binary_fingerprint[16] = {0xDE,0x05,0x1F,0xC9,0xAA,0x97,0x87,0x4E,0x78,0x5B,0x79,0x0F,0x80,0x86,0x69,0x1F};

uint32_t Resource::read(::apache::thrift::protocol::TProtocol* iprot) {

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;


  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->guid);
          this->__isset.guid = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->noteGuid);
          this->__isset.noteGuid = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_STRUCT) {
          xfer += this->data.read(iprot);
          this->__isset.data = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->mime);
          this->__isset.mime = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 5:
        if (ftype == ::apache::thrift::protocol::T_I16) {
          xfer += iprot->readI16(this->width);
          this->__isset.width = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 6:
        if (ftype == ::apache::thrift::protocol::T_I16) {
          xfer += iprot->readI16(this->height);
          this->__isset.height = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 7:
        if (ftype == ::apache::thrift::protocol::T_I16) {
          xfer += iprot->readI16(this->duration);
          this->__isset.duration = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 8:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->active);
          this->__isset.active = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 9:
        if (ftype == ::apache::thrift::protocol::T_STRUCT) {
          xfer += this->recognition.read(iprot);
          this->__isset.recognition = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 11:
        if (ftype == ::apache::thrift::protocol::T_STRUCT) {
          xfer += this->attributes.read(iprot);
          this->__isset.attributes = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 12:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->updateSequenceNum);
          this->__isset.updateSequenceNum = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 13:
        if (ftype == ::apache::thrift::protocol::T_STRUCT) {
          xfer += this->alternateData.read(iprot);
          this->__isset.alternateData = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t Resource::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  xfer += oprot->writeStructBegin("Resource");
  if (this->__isset.guid) {
    xfer += oprot->writeFieldBegin("guid", ::apache::thrift::protocol::T_STRING, 1);
    xfer += oprot->writeString(this->guid);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.noteGuid) {
    xfer += oprot->writeFieldBegin("noteGuid", ::apache::thrift::protocol::T_STRING, 2);
    xfer += oprot->writeString(this->noteGuid);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.data) {
    xfer += oprot->writeFieldBegin("data", ::apache::thrift::protocol::T_STRUCT, 3);
    xfer += this->data.write(oprot);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.mime) {
    xfer += oprot->writeFieldBegin("mime", ::apache::thrift::protocol::T_STRING, 4);
    xfer += oprot->writeString(this->mime);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.width) {
    xfer += oprot->writeFieldBegin("width", ::apache::thrift::protocol::T_I16, 5);
    xfer += oprot->writeI16(this->width);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.height) {
    xfer += oprot->writeFieldBegin("height", ::apache::thrift::protocol::T_I16, 6);
    xfer += oprot->writeI16(this->height);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.duration) {
    xfer += oprot->writeFieldBegin("duration", ::apache::thrift::protocol::T_I16, 7);
    xfer += oprot->writeI16(this->duration);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.active) {
    xfer += oprot->writeFieldBegin("active", ::apache::thrift::protocol::T_BOOL, 8);
    xfer += oprot->writeBool(this->active);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.recognition) {
    xfer += oprot->writeFieldBegin("recognition", ::apache::thrift::protocol::T_STRUCT, 9);
    xfer += this->recognition.write(oprot);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.attributes) {
    xfer += oprot->writeFieldBegin("attributes", ::apache::thrift::protocol::T_STRUCT, 11);
    xfer += this->attributes.write(oprot);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.updateSequenceNum) {
    xfer += oprot->writeFieldBegin("updateSequenceNum", ::apache::thrift::protocol::T_I32, 12);
    xfer += oprot->writeI32(this->updateSequenceNum);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.alternateData) {
    xfer += oprot->writeFieldBegin("alternateData", ::apache::thrift::protocol::T_STRUCT, 13);
    xfer += this->alternateData.write(oprot);
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

const char* NoteAttributes::ascii_fingerprint = "BA560CD15125242A550F8A524019638D";
const uint8_t NoteAttributes::binary_fingerprint[16] = {0xBA,0x56,0x0C,0xD1,0x51,0x25,0x24,0x2A,0x55,0x0F,0x8A,0x52,0x40,0x19,0x63,0x8D};

uint32_t NoteAttributes::read(::apache::thrift::protocol::TProtocol* iprot) {

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;


  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->subjectDate);
          this->__isset.subjectDate = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 10:
        if (ftype == ::apache::thrift::protocol::T_DOUBLE) {
          xfer += iprot->readDouble(this->latitude);
          this->__isset.latitude = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 11:
        if (ftype == ::apache::thrift::protocol::T_DOUBLE) {
          xfer += iprot->readDouble(this->longitude);
          this->__isset.longitude = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 12:
        if (ftype == ::apache::thrift::protocol::T_DOUBLE) {
          xfer += iprot->readDouble(this->altitude);
          this->__isset.altitude = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 13:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->author);
          this->__isset.author = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 14:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->source);
          this->__isset.source = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 15:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->sourceURL);
          this->__isset.sourceURL = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 16:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->sourceApplication);
          this->__isset.sourceApplication = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 17:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->shareDate);
          this->__isset.shareDate = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 18:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->taskDate);
          this->__isset.taskDate = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 19:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->taskCompleteDate);
          this->__isset.taskCompleteDate = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 20:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->taskDueDate);
          this->__isset.taskDueDate = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 21:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->placeName);
          this->__isset.placeName = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 22:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->contentClass);
          this->__isset.contentClass = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 23:
        if (ftype == ::apache::thrift::protocol::T_STRUCT) {
          xfer += this->applicationData.read(iprot);
          this->__isset.applicationData = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t NoteAttributes::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  xfer += oprot->writeStructBegin("NoteAttributes");
  if (this->__isset.subjectDate) {
    xfer += oprot->writeFieldBegin("subjectDate", ::apache::thrift::protocol::T_I64, 1);
    xfer += oprot->writeI64(this->subjectDate);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.latitude) {
    xfer += oprot->writeFieldBegin("latitude", ::apache::thrift::protocol::T_DOUBLE, 10);
    xfer += oprot->writeDouble(this->latitude);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.longitude) {
    xfer += oprot->writeFieldBegin("longitude", ::apache::thrift::protocol::T_DOUBLE, 11);
    xfer += oprot->writeDouble(this->longitude);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.altitude) {
    xfer += oprot->writeFieldBegin("altitude", ::apache::thrift::protocol::T_DOUBLE, 12);
    xfer += oprot->writeDouble(this->altitude);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.author) {
    xfer += oprot->writeFieldBegin("author", ::apache::thrift::protocol::T_STRING, 13);
    xfer += oprot->writeString(this->author);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.source) {
    xfer += oprot->writeFieldBegin("source", ::apache::thrift::protocol::T_STRING, 14);
    xfer += oprot->writeString(this->source);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.sourceURL) {
    xfer += oprot->writeFieldBegin("sourceURL", ::apache::thrift::protocol::T_STRING, 15);
    xfer += oprot->writeString(this->sourceURL);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.sourceApplication) {
    xfer += oprot->writeFieldBegin("sourceApplication", ::apache::thrift::protocol::T_STRING, 16);
    xfer += oprot->writeString(this->sourceApplication);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.shareDate) {
    xfer += oprot->writeFieldBegin("shareDate", ::apache::thrift::protocol::T_I64, 17);
    xfer += oprot->writeI64(this->shareDate);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.taskDate) {
    xfer += oprot->writeFieldBegin("taskDate", ::apache::thrift::protocol::T_I64, 18);
    xfer += oprot->writeI64(this->taskDate);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.taskCompleteDate) {
    xfer += oprot->writeFieldBegin("taskCompleteDate", ::apache::thrift::protocol::T_I64, 19);
    xfer += oprot->writeI64(this->taskCompleteDate);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.taskDueDate) {
    xfer += oprot->writeFieldBegin("taskDueDate", ::apache::thrift::protocol::T_I64, 20);
    xfer += oprot->writeI64(this->taskDueDate);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.placeName) {
    xfer += oprot->writeFieldBegin("placeName", ::apache::thrift::protocol::T_STRING, 21);
    xfer += oprot->writeString(this->placeName);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.contentClass) {
    xfer += oprot->writeFieldBegin("contentClass", ::apache::thrift::protocol::T_STRING, 22);
    xfer += oprot->writeString(this->contentClass);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.applicationData) {
    xfer += oprot->writeFieldBegin("applicationData", ::apache::thrift::protocol::T_STRUCT, 23);
    xfer += this->applicationData.write(oprot);
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

const char* Note::ascii_fingerprint = "04B8FFD8610609B8E842B881B6FEA0A0";
const uint8_t Note::binary_fingerprint[16] = {0x04,0xB8,0xFF,0xD8,0x61,0x06,0x09,0xB8,0xE8,0x42,0xB8,0x81,0xB6,0xFE,0xA0,0xA0};

uint32_t Note::read(::apache::thrift::protocol::TProtocol* iprot) {

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;


  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->guid);
          this->__isset.guid = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->title);
          this->__isset.title = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->content);
          this->__isset.content = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readBinary(this->contentHash);
          this->__isset.contentHash = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 5:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->contentLength);
          this->__isset.contentLength = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 6:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->created);
          this->__isset.created = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 7:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->updated);
          this->__isset.updated = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 8:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->deleted);
          this->__isset.deleted = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 9:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->active);
          this->__isset.active = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 10:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->updateSequenceNum);
          this->__isset.updateSequenceNum = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 11:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->notebookGuid);
          this->__isset.notebookGuid = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 12:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->tagGuids.clear();
            uint32_t _size29;
            ::apache::thrift::protocol::TType _etype32;
            iprot->readListBegin(_etype32, _size29);
            this->tagGuids.resize(_size29);
            uint32_t _i33;
            for (_i33 = 0; _i33 < _size29; ++_i33)
            {
              xfer += iprot->readString(this->tagGuids[_i33]);
            }
            iprot->readListEnd();
          }
          this->__isset.tagGuids = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 13:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->resources.clear();
            uint32_t _size34;
            ::apache::thrift::protocol::TType _etype37;
            iprot->readListBegin(_etype37, _size34);
            this->resources.resize(_size34);
            uint32_t _i38;
            for (_i38 = 0; _i38 < _size34; ++_i38)
            {
              xfer += this->resources[_i38].read(iprot);
            }
            iprot->readListEnd();
          }
          this->__isset.resources = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 14:
        if (ftype == ::apache::thrift::protocol::T_STRUCT) {
          xfer += this->attributes.read(iprot);
          this->__isset.attributes = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 15:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->tagNames.clear();
            uint32_t _size39;
            ::apache::thrift::protocol::TType _etype42;
            iprot->readListBegin(_etype42, _size39);
            this->tagNames.resize(_size39);
            uint32_t _i43;
            for (_i43 = 0; _i43 < _size39; ++_i43)
            {
              xfer += iprot->readString(this->tagNames[_i43]);
            }
            iprot->readListEnd();
          }
          this->__isset.tagNames = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t Note::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  xfer += oprot->writeStructBegin("Note");
  if (this->__isset.guid) {
    xfer += oprot->writeFieldBegin("guid", ::apache::thrift::protocol::T_STRING, 1);
    xfer += oprot->writeString(this->guid);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.title) {
    xfer += oprot->writeFieldBegin("title", ::apache::thrift::protocol::T_STRING, 2);
    xfer += oprot->writeString(this->title);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.content) {
    xfer += oprot->writeFieldBegin("content", ::apache::thrift::protocol::T_STRING, 3);
    xfer += oprot->writeString(this->content);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.contentHash) {
    xfer += oprot->writeFieldBegin("contentHash", ::apache::thrift::protocol::T_STRING, 4);
    xfer += oprot->writeBinary(this->contentHash);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.contentLength) {
    xfer += oprot->writeFieldBegin("contentLength", ::apache::thrift::protocol::T_I32, 5);
    xfer += oprot->writeI32(this->contentLength);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.created) {
    xfer += oprot->writeFieldBegin("created", ::apache::thrift::protocol::T_I64, 6);
    xfer += oprot->writeI64(this->created);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.updated) {
    xfer += oprot->writeFieldBegin("updated", ::apache::thrift::protocol::T_I64, 7);
    xfer += oprot->writeI64(this->updated);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.deleted) {
    xfer += oprot->writeFieldBegin("deleted", ::apache::thrift::protocol::T_I64, 8);
    xfer += oprot->writeI64(this->deleted);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.active) {
    xfer += oprot->writeFieldBegin("active", ::apache::thrift::protocol::T_BOOL, 9);
    xfer += oprot->writeBool(this->active);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.updateSequenceNum) {
    xfer += oprot->writeFieldBegin("updateSequenceNum", ::apache::thrift::protocol::T_I32, 10);
    xfer += oprot->writeI32(this->updateSequenceNum);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.notebookGuid) {
    xfer += oprot->writeFieldBegin("notebookGuid", ::apache::thrift::protocol::T_STRING, 11);
    xfer += oprot->writeString(this->notebookGuid);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.tagGuids) {
    xfer += oprot->writeFieldBegin("tagGuids", ::apache::thrift::protocol::T_LIST, 12);
    {
      xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, this->tagGuids.size());
      std::vector<Guid> ::const_iterator _iter44;
      for (_iter44 = this->tagGuids.begin(); _iter44 != this->tagGuids.end(); ++_iter44)
      {
        xfer += oprot->writeString((*_iter44));
      }
      xfer += oprot->writeListEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.resources) {
    xfer += oprot->writeFieldBegin("resources", ::apache::thrift::protocol::T_LIST, 13);
    {
      xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, this->resources.size());
      std::vector<Resource> ::const_iterator _iter45;
      for (_iter45 = this->resources.begin(); _iter45 != this->resources.end(); ++_iter45)
      {
        xfer += (*_iter45).write(oprot);
      }
      xfer += oprot->writeListEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.attributes) {
    xfer += oprot->writeFieldBegin("attributes", ::apache::thrift::protocol::T_STRUCT, 14);
    xfer += this->attributes.write(oprot);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.tagNames) {
    xfer += oprot->writeFieldBegin("tagNames", ::apache::thrift::protocol::T_LIST, 15);
    {
      xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, this->tagNames.size());
      std::vector<std::string> ::const_iterator _iter46;
      for (_iter46 = this->tagNames.begin(); _iter46 != this->tagNames.end(); ++_iter46)
      {
        xfer += oprot->writeString((*_iter46));
      }
      xfer += oprot->writeListEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

const char* Publishing::ascii_fingerprint = "A62655866CF21A0C0C20242173A3567A";
const uint8_t Publishing::binary_fingerprint[16] = {0xA6,0x26,0x55,0x86,0x6C,0xF2,0x1A,0x0C,0x0C,0x20,0x24,0x21,0x73,0xA3,0x56,0x7A};

uint32_t Publishing::read(::apache::thrift::protocol::TProtocol* iprot) {

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;


  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->uri);
          this->__isset.uri = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          int32_t ecast47;
          xfer += iprot->readI32(ecast47);
          this->order = (NoteSortOrder)ecast47;
          this->__isset.order = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->ascending);
          this->__isset.ascending = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->publicDescription);
          this->__isset.publicDescription = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t Publishing::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  xfer += oprot->writeStructBegin("Publishing");
  if (this->__isset.uri) {
    xfer += oprot->writeFieldBegin("uri", ::apache::thrift::protocol::T_STRING, 1);
    xfer += oprot->writeString(this->uri);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.order) {
    xfer += oprot->writeFieldBegin("order", ::apache::thrift::protocol::T_I32, 2);
    xfer += oprot->writeI32((int32_t)this->order);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.ascending) {
    xfer += oprot->writeFieldBegin("ascending", ::apache::thrift::protocol::T_BOOL, 3);
    xfer += oprot->writeBool(this->ascending);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.publicDescription) {
    xfer += oprot->writeFieldBegin("publicDescription", ::apache::thrift::protocol::T_STRING, 4);
    xfer += oprot->writeString(this->publicDescription);
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

const char* Notebook::ascii_fingerprint = "F3369A1433C6E2E50BA324743A958530";
const uint8_t Notebook::binary_fingerprint[16] = {0xF3,0x36,0x9A,0x14,0x33,0xC6,0xE2,0xE5,0x0B,0xA3,0x24,0x74,0x3A,0x95,0x85,0x30};

uint32_t Notebook::read(::apache::thrift::protocol::TProtocol* iprot) {

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;


  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->guid);
          this->__isset.guid = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->name);
          this->__isset.name = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 5:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->updateSequenceNum);
          this->__isset.updateSequenceNum = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 6:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->defaultNotebook);
          this->__isset.defaultNotebook = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 7:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->serviceCreated);
          this->__isset.serviceCreated = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 8:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->serviceUpdated);
          this->__isset.serviceUpdated = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 10:
        if (ftype == ::apache::thrift::protocol::T_STRUCT) {
          xfer += this->publishing.read(iprot);
          this->__isset.publishing = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 11:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->published);
          this->__isset.published = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 12:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->stack);
          this->__isset.stack = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 13:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->sharedNotebookIds.clear();
            uint32_t _size48;
            ::apache::thrift::protocol::TType _etype51;
            iprot->readListBegin(_etype51, _size48);
            this->sharedNotebookIds.resize(_size48);
            uint32_t _i52;
            for (_i52 = 0; _i52 < _size48; ++_i52)
            {
              xfer += iprot->readI64(this->sharedNotebookIds[_i52]);
            }
            iprot->readListEnd();
          }
          this->__isset.sharedNotebookIds = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t Notebook::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  xfer += oprot->writeStructBegin("Notebook");
  if (this->__isset.guid) {
    xfer += oprot->writeFieldBegin("guid", ::apache::thrift::protocol::T_STRING, 1);
    xfer += oprot->writeString(this->guid);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.name) {
    xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 2);
    xfer += oprot->writeString(this->name);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.updateSequenceNum) {
    xfer += oprot->writeFieldBegin("updateSequenceNum", ::apache::thrift::protocol::T_I32, 5);
    xfer += oprot->writeI32(this->updateSequenceNum);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.defaultNotebook) {
    xfer += oprot->writeFieldBegin("defaultNotebook", ::apache::thrift::protocol::T_BOOL, 6);
    xfer += oprot->writeBool(this->defaultNotebook);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.serviceCreated) {
    xfer += oprot->writeFieldBegin("serviceCreated", ::apache::thrift::protocol::T_I64, 7);
    xfer += oprot->writeI64(this->serviceCreated);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.serviceUpdated) {
    xfer += oprot->writeFieldBegin("serviceUpdated", ::apache::thrift::protocol::T_I64, 8);
    xfer += oprot->writeI64(this->serviceUpdated);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.publishing) {
    xfer += oprot->writeFieldBegin("publishing", ::apache::thrift::protocol::T_STRUCT, 10);
    xfer += this->publishing.write(oprot);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.published) {
    xfer += oprot->writeFieldBegin("published", ::apache::thrift::protocol::T_BOOL, 11);
    xfer += oprot->writeBool(this->published);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.stack) {
    xfer += oprot->writeFieldBegin("stack", ::apache::thrift::protocol::T_STRING, 12);
    xfer += oprot->writeString(this->stack);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.sharedNotebookIds) {
    xfer += oprot->writeFieldBegin("sharedNotebookIds", ::apache::thrift::protocol::T_LIST, 13);
    {
      xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I64, this->sharedNotebookIds.size());
      std::vector<int64_t> ::const_iterator _iter53;
      for (_iter53 = this->sharedNotebookIds.begin(); _iter53 != this->sharedNotebookIds.end(); ++_iter53)
      {
        xfer += oprot->writeI64((*_iter53));
      }
      xfer += oprot->writeListEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

const char* SavedSearch::ascii_fingerprint = "F8123D2B1DD5C24610D0B2386CFF86D2";
const uint8_t SavedSearch::binary_fingerprint[16] = {0xF8,0x12,0x3D,0x2B,0x1D,0xD5,0xC2,0x46,0x10,0xD0,0xB2,0x38,0x6C,0xFF,0x86,0xD2};

uint32_t SavedSearch::read(::apache::thrift::protocol::TProtocol* iprot) {

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;


  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->guid);
          this->__isset.guid = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->name);
          this->__isset.name = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->query);
          this->__isset.query = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          int32_t ecast54;
          xfer += iprot->readI32(ecast54);
          this->format = (QueryFormat)ecast54;
          this->__isset.format = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 5:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->updateSequenceNum);
          this->__isset.updateSequenceNum = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t SavedSearch::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  xfer += oprot->writeStructBegin("SavedSearch");
  if (this->__isset.guid) {
    xfer += oprot->writeFieldBegin("guid", ::apache::thrift::protocol::T_STRING, 1);
    xfer += oprot->writeString(this->guid);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.name) {
    xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 2);
    xfer += oprot->writeString(this->name);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.query) {
    xfer += oprot->writeFieldBegin("query", ::apache::thrift::protocol::T_STRING, 3);
    xfer += oprot->writeString(this->query);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.format) {
    xfer += oprot->writeFieldBegin("format", ::apache::thrift::protocol::T_I32, 4);
    xfer += oprot->writeI32((int32_t)this->format);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.updateSequenceNum) {
    xfer += oprot->writeFieldBegin("updateSequenceNum", ::apache::thrift::protocol::T_I32, 5);
    xfer += oprot->writeI32(this->updateSequenceNum);
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

const char* Ad::ascii_fingerprint = "B8D16DBF4D96C6731F20EB1819144E0E";
const uint8_t Ad::binary_fingerprint[16] = {0xB8,0xD1,0x6D,0xBF,0x4D,0x96,0xC6,0x73,0x1F,0x20,0xEB,0x18,0x19,0x14,0x4E,0x0E};

uint32_t Ad::read(::apache::thrift::protocol::TProtocol* iprot) {

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;


  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->id);
          this->__isset.id = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_I16) {
          xfer += iprot->readI16(this->width);
          this->__isset.width = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_I16) {
          xfer += iprot->readI16(this->height);
          this->__isset.height = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->advertiserName);
          this->__isset.advertiserName = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 5:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->imageUrl);
          this->__isset.imageUrl = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 6:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->destinationUrl);
          this->__isset.destinationUrl = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 7:
        if (ftype == ::apache::thrift::protocol::T_I16) {
          xfer += iprot->readI16(this->displaySeconds);
          this->__isset.displaySeconds = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 8:
        if (ftype == ::apache::thrift::protocol::T_DOUBLE) {
          xfer += iprot->readDouble(this->score);
          this->__isset.score = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 9:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readBinary(this->image);
          this->__isset.image = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 10:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->imageMime);
          this->__isset.imageMime = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 11:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->html);
          this->__isset.html = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 12:
        if (ftype == ::apache::thrift::protocol::T_DOUBLE) {
          xfer += iprot->readDouble(this->displayFrequency);
          this->__isset.displayFrequency = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 13:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->openInTrunk);
          this->__isset.openInTrunk = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t Ad::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  xfer += oprot->writeStructBegin("Ad");
  if (this->__isset.id) {
    xfer += oprot->writeFieldBegin("id", ::apache::thrift::protocol::T_I32, 1);
    xfer += oprot->writeI32(this->id);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.width) {
    xfer += oprot->writeFieldBegin("width", ::apache::thrift::protocol::T_I16, 2);
    xfer += oprot->writeI16(this->width);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.height) {
    xfer += oprot->writeFieldBegin("height", ::apache::thrift::protocol::T_I16, 3);
    xfer += oprot->writeI16(this->height);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.advertiserName) {
    xfer += oprot->writeFieldBegin("advertiserName", ::apache::thrift::protocol::T_STRING, 4);
    xfer += oprot->writeString(this->advertiserName);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.imageUrl) {
    xfer += oprot->writeFieldBegin("imageUrl", ::apache::thrift::protocol::T_STRING, 5);
    xfer += oprot->writeString(this->imageUrl);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.destinationUrl) {
    xfer += oprot->writeFieldBegin("destinationUrl", ::apache::thrift::protocol::T_STRING, 6);
    xfer += oprot->writeString(this->destinationUrl);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.displaySeconds) {
    xfer += oprot->writeFieldBegin("displaySeconds", ::apache::thrift::protocol::T_I16, 7);
    xfer += oprot->writeI16(this->displaySeconds);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.score) {
    xfer += oprot->writeFieldBegin("score", ::apache::thrift::protocol::T_DOUBLE, 8);
    xfer += oprot->writeDouble(this->score);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.image) {
    xfer += oprot->writeFieldBegin("image", ::apache::thrift::protocol::T_STRING, 9);
    xfer += oprot->writeBinary(this->image);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.imageMime) {
    xfer += oprot->writeFieldBegin("imageMime", ::apache::thrift::protocol::T_STRING, 10);
    xfer += oprot->writeString(this->imageMime);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.html) {
    xfer += oprot->writeFieldBegin("html", ::apache::thrift::protocol::T_STRING, 11);
    xfer += oprot->writeString(this->html);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.displayFrequency) {
    xfer += oprot->writeFieldBegin("displayFrequency", ::apache::thrift::protocol::T_DOUBLE, 12);
    xfer += oprot->writeDouble(this->displayFrequency);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.openInTrunk) {
    xfer += oprot->writeFieldBegin("openInTrunk", ::apache::thrift::protocol::T_BOOL, 13);
    xfer += oprot->writeBool(this->openInTrunk);
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

const char* SharedNotebook::ascii_fingerprint = "3ECBE8380CBD03A6168589256068F022";
const uint8_t SharedNotebook::binary_fingerprint[16] = {0x3E,0xCB,0xE8,0x38,0x0C,0xBD,0x03,0xA6,0x16,0x85,0x89,0x25,0x60,0x68,0xF0,0x22};

uint32_t SharedNotebook::read(::apache::thrift::protocol::TProtocol* iprot) {

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;


  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->id);
          this->__isset.id = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->userId);
          this->__isset.userId = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->notebookGuid);
          this->__isset.notebookGuid = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->email);
          this->__isset.email = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 5:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->notebookModifiable);
          this->__isset.notebookModifiable = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 6:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->requireLogin);
          this->__isset.requireLogin = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 7:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->serviceCreated);
          this->__isset.serviceCreated = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 8:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->shareKey);
          this->__isset.shareKey = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 9:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->username);
          this->__isset.username = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t SharedNotebook::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  xfer += oprot->writeStructBegin("SharedNotebook");
  if (this->__isset.id) {
    xfer += oprot->writeFieldBegin("id", ::apache::thrift::protocol::T_I64, 1);
    xfer += oprot->writeI64(this->id);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.userId) {
    xfer += oprot->writeFieldBegin("userId", ::apache::thrift::protocol::T_I32, 2);
    xfer += oprot->writeI32(this->userId);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.notebookGuid) {
    xfer += oprot->writeFieldBegin("notebookGuid", ::apache::thrift::protocol::T_STRING, 3);
    xfer += oprot->writeString(this->notebookGuid);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.email) {
    xfer += oprot->writeFieldBegin("email", ::apache::thrift::protocol::T_STRING, 4);
    xfer += oprot->writeString(this->email);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.notebookModifiable) {
    xfer += oprot->writeFieldBegin("notebookModifiable", ::apache::thrift::protocol::T_BOOL, 5);
    xfer += oprot->writeBool(this->notebookModifiable);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.requireLogin) {
    xfer += oprot->writeFieldBegin("requireLogin", ::apache::thrift::protocol::T_BOOL, 6);
    xfer += oprot->writeBool(this->requireLogin);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.serviceCreated) {
    xfer += oprot->writeFieldBegin("serviceCreated", ::apache::thrift::protocol::T_I64, 7);
    xfer += oprot->writeI64(this->serviceCreated);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.shareKey) {
    xfer += oprot->writeFieldBegin("shareKey", ::apache::thrift::protocol::T_STRING, 8);
    xfer += oprot->writeString(this->shareKey);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.username) {
    xfer += oprot->writeFieldBegin("username", ::apache::thrift::protocol::T_STRING, 9);
    xfer += oprot->writeString(this->username);
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

const char* LinkedNotebook::ascii_fingerprint = "313B8BA8E73A1D00DE5964E5A810E343";
const uint8_t LinkedNotebook::binary_fingerprint[16] = {0x31,0x3B,0x8B,0xA8,0xE7,0x3A,0x1D,0x00,0xDE,0x59,0x64,0xE5,0xA8,0x10,0xE3,0x43};

uint32_t LinkedNotebook::read(::apache::thrift::protocol::TProtocol* iprot) {

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;


  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 2:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->shareName);
          this->__isset.shareName = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->username);
          this->__isset.username = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->shardId);
          this->__isset.shardId = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 5:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->shareKey);
          this->__isset.shareKey = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 6:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->uri);
          this->__isset.uri = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 7:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->guid);
          this->__isset.guid = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 8:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->updateSequenceNum);
          this->__isset.updateSequenceNum = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t LinkedNotebook::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  xfer += oprot->writeStructBegin("LinkedNotebook");
  if (this->__isset.shareName) {
    xfer += oprot->writeFieldBegin("shareName", ::apache::thrift::protocol::T_STRING, 2);
    xfer += oprot->writeString(this->shareName);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.username) {
    xfer += oprot->writeFieldBegin("username", ::apache::thrift::protocol::T_STRING, 3);
    xfer += oprot->writeString(this->username);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.shardId) {
    xfer += oprot->writeFieldBegin("shardId", ::apache::thrift::protocol::T_STRING, 4);
    xfer += oprot->writeString(this->shardId);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.shareKey) {
    xfer += oprot->writeFieldBegin("shareKey", ::apache::thrift::protocol::T_STRING, 5);
    xfer += oprot->writeString(this->shareKey);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.uri) {
    xfer += oprot->writeFieldBegin("uri", ::apache::thrift::protocol::T_STRING, 6);
    xfer += oprot->writeString(this->uri);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.guid) {
    xfer += oprot->writeFieldBegin("guid", ::apache::thrift::protocol::T_STRING, 7);
    xfer += oprot->writeString(this->guid);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.updateSequenceNum) {
    xfer += oprot->writeFieldBegin("updateSequenceNum", ::apache::thrift::protocol::T_I32, 8);
    xfer += oprot->writeI32(this->updateSequenceNum);
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

}} // namespace
